<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<meta name="format-detection" content="telephone=no,address=no,email=no"/>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<title>KAA电商管理后台_权限管理</title>
	<script type="text/javascript" src="${path}/js/jquery-2.1.1.min.js"></script>
	<script src="${path}/js/sidebar-menu.js"></script>
	<link href="${path}/css/login.css" rel="stylesheet" media="all">
</head>
<script>
    function fun(){
        obj = document.getElementsByName("product");
        obj1 = document.getElementsByName("user");
        obj2 = document.getElementsByName("order");
        obj3 = document.getElementsByName("menu");
        check_val = [];
        check_val1 = [];
        check_val2 = [];
        check_val3 = [];
        for(k in obj){
            if(obj[k].checked)
                check_val.push(obj[k].value);
        }
        for(x in obj1){
            if(obj1[x].checked)
                check_val1.push(obj1[x].value);
        }
        for(y in obj2){
            if(obj2[y].checked)
                check_val2.push(obj2[y].value);
        }
        for(z in obj3){
            if(obj3[z].checked)
                check_val3.push(obj3[z].value);
        }
		$("#productListIds").val(check_val)
        $("#userListIds").val(check_val1)
        $("#orderListIds").val(check_val2)
        $("#systemListIds").val(check_val3)
    }
</script>
<body class="main">
	<h1>KAA电商管理后台</h1>
	<jsp:include page="sidebarNav.jsp"></jsp:include><!-- main_sidebar -->

	<div class="main_con_wrap">
		<div class="main_con right_adm">
			<form name="rightadm_form" id="rightadm_form" action="${path}/addMenuPermissions">
				<input id="productListIds" name="productListIds" value="" style="display: none">
				<input id="userListIds" name="userListIds" value="" style="display: none">
				<input id="orderListIds" name="orderListIds" value="" style="display: none">
				<input id="systemListIds" name="systemListIds" value="" style="display: none">
				<p class="rightadm_tl fl">角色名称</p>	
				<p class="rightadm_tabr fl">
					<select id="rightadm_sel" name="role">
						<c:forEach items="${roleList}" var="item">
					  <option selected="" value="${item.id}">${item.roleName}</option>
						</c:forEach>
					</select>
				</p>	
				<p class="rightadm_tl fl nobor">权限设置</p>
				<ul class="rightadm_tabr fl">
					<li>
						<span class="rightadm_tl fl">商品</span>
						<p class="rightadm_checkr fl">
							<span><input type="checkbox" name="product" value="5">商品列表</span>
							<span><input type="checkbox" name="product" value="6">商品分类</span>
							<span><input type="checkbox" name="product" value="7">商品添加</span>
						</p>
						<div class="clear"></div>
					</li>
					<li>
						<span class="rightadm_tl fl">会员</span>
						<p class="rightadm_checkr fl">
							<span><input type="checkbox" name="user" value="8">会员列表</span>
							<span><input type="checkbox" name="user" value="9">会员添加</span>
							<span><input type="checkbox" name="user" value="10">会员积分组</span>
							<span><input type="checkbox" name="user" value="11">积分管理</span>
						</p>
						<div class="clear"></div>
					</li>
					<li>
						<span class="rightadm_tl fl">订单</span>
						<p class="rightadm_checkr fl">
							<span><input type="checkbox" name="order" value="12">订单列表</span>
							<span><input type="checkbox" name="order" value="13">作废订单</span>
							<span><input type="checkbox" name="order" value="14">发货地址</span>
						</p>
						<div class="clear"></div>
					</li>
					<li>
						<span class="rightadm_tl fl">系统</span>
						<p class="rightadm_checkr fl">
							<span><input type="checkbox" name="menu" value="15">人员管理</span>
							<span><input type="checkbox" name="menu" value="16">角色管理</span>
							<span><input type="checkbox" name="menu" value="17">权限管理</span>
							<span><input type="checkbox" name="menu" value="18">修改密码</span>
						</p>
						<div class="clear"></div>
					</li>
				</ul>
				<div class="clear"></div>
				<button name="button" class="rightadm_btn btn" id="rightadm_btn" onclick="fun()">保存</button>
			</form>
		</div><!-- main_con -->
	</div><!-- main_con_wrap -->

	<div class="footer_copyright">
		<p>苏州知行合一网络科技有限公司提供技术支持，版权所有</p>
	</div><!-- footer_copyright -->

<script>
	/////////////////////////侧边栏按钮
	$.sidebarMenu($('.sidebar-menu'))
</script>
</body>
</html>